import React, { Component } from 'react';

import { List } from 'immutable';

export default class App extends Component {
  state = {
    list: List(['a', 'b', 'c']),
  };

  componentDidMount() {}

  render() {
    return (
      <div>
        App
        <div>
          <button
            onClick={() => {
              this.setState({
                list: this.state.list.push('' + Math.random()),
              });
            }}>
            click
          </button>
          <ul>
            {this.state.list.map((item) => {
              return <li key={item}>{item}</li>;
            })}
          </ul>
        </div>
      </div>
    );
  }
}

// let arr1 = List(['a', 'b', 'c']);
// console.log(arr1);

// let arr2 = arr1.push('d'); // 不会影响之前的数据
// console.log(arr2);

// let arr3 = arr1.concat(['d', 'e']);
// console.log(arr3);
